home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 2
/
Atari Mega Archive CD - Volume 2.iso
/
8bit
/
cislib_b
/
set.asm
< prev
next >
Wrap
Assembly Source File
|
1995-04-22
|
4KB
|
139 lines
00010 ;SAVE"D:SET.SYN
00020 ; .LI OFF
00030 ; This program switches the
00040 ; density for one PERCOM
00050 ; compatible drive. The
00060 ; allowed settings are:
00070 ; S=single, D=double, E=1050.
00080 ; Command format is:
00090 ; SET 1D
00091 ;
00092 ; NOTE: The 1050 format allows
00093 ; you to read or write 1050
00094 ; density disks, but does
00095 ; not allow you to format disks
00096 ; in that density.
00100 ;
00110 ******************************
00120 * Daniel L. Moore 03/19/84 *
00130 ******************************
00140 ;
00150 DOSVEC .EQ $A
00160 DOSINIT .EQ $7E0 FMS v. 2
00170 DENSITY .EQ $D4 FP register 0
00180 ;
00190 ; OS/A+ equates
00200 CPBUFP .EQ $A next char.
00210 CPCMDB .EQ $3F command buff.
00220 ; SIO equates
00230 DDEVIC .EQ $300
00240 DUNIT .EQ $301
00250 DCOMND .EQ $302
00260 DSTATS .EQ $303
00270 DBUFLO .EQ $304
00280 DBYTLO .EQ $308
00290 ; Data direction control
00300 IN .EQ $40
00310 OUT .EQ $80
00320 ; PERCOM drive table
00330 READ .EQ $4E
00340 WRITE .EQ $4F
00350 LENGTH .EQ 12
00360 FM .EQ 0 FM recording
00370 MFM .EQ 4 MFM recording
00380 ;
00390 SIO .EQ $E459
00400 ;
00410 .OR $4000
00420 ;
00430 START CLC
00440 LDY #CPBUFP
00450 LDA (DOSVEC),Y
00460 ADC #CPCMDB+1
00470 TAY
00480 LDA (DOSVEC),Y drive #
00490 ; Test for drive 1 to 8.
00500 CMP #'1
00510 BCC DOS
00520 CMP #'9
00530 BCS DOS
00540 CLC
00550 SBC #'0-1
00560 STA DUNIT
00570 LDA #$31
00580 STA DDEVIC
00590 ; Test for S(0), D(1), E(2)
00600 LDX #0
00610 INY
00620 LDA (DOSVEC),Y
00630 CMP #'S
00640 BEQ SETIT
00650 INX
00660 CMP #'D
00670 BEQ SETIT
00680 INX
00690 CMP #'E
00700 BEQ SETIT
00710 DOS RTS
00720 ;
00730 SETIT STX DENSITY
00740 ; First read in the current
00750 ; control table.
00760 LDA #IN
00770 STA DSTATS
00780 LDA #READ
00790 STA DCOMND
00800 LDA #LENGTH
00810 STA DBYTLO
00820 LDA #0
00830 STA DBYTLO+1
00840 LDA #TABLE
00850 STA DBUFLO
00860 LDA /TABLE
00870 STA DBUFLO+1
00880 JSR SIO
00890 BMI DOS exit if error
00900 ; Then modify the control bytes
00910 ; First recording technique
00920 LDA DENSITY
00930 BNE SET.MFM
00940 LDX #FM
00950 BEQ SET
00960 SET.MFM LDX #MFM
00970 SET STX TABLE+5
00980 ; Then set the sector length
00990 CMP #1
01000 BEQ S.256
01010 LDX #$80 128 bytes
01020 LDY #$00
01030 BEQ SETLEN
01040 S.256 LDX #$00 256 bytes
01050 LDY #$01
01060 SETLEN STY TABLE+6 High byte
01070 STX TABLE+7 Low byte
01080 ; Then set the number of
01090 ; sectors per track.
01100 CMP #2
01110 BEQ S.26
01120 LDX #18 18 sectors
01130 BNE SETSECT
01140 S.26 LDX #26 26 sectors
01150 SETSECT STX TABLE+3
01160 ; Then write the table out.
01170 LDA #OUT
01180 STA DSTATS
01190 LDA #WRITE
01200 STA DCOMND
01210 JSR SIO
01220 ; Init DOS for the current
01230 ; density.
01240 JSR DOSINIT
01250 ; Then return to DOS.
01260 RTS
01270 ;
01280 ; DRIVE table.
01290 TABLE .EQ *
01300 ;
01310 END .LI ON